import { DependencyOptimizer } from './service'
import { CompatibilityTree } from '../compatibility-tree'

/**
 * 依赖优化模块入口
 * 提供基于兼容树的智能依赖优化能力
 */
export {
  DependencyOptimizer,
  /**
   * 初始化依赖优化器
   * @param tree 兼容树实例
   * @returns 优化器实例
   */
  function createDependencyOptimizer(tree: CompatibilityTree) {
    return new DependencyOptimizer(tree)
  }
}

/**
 * 使用示例：
 * 
 * ```typescript
 * import { createDependencyOptimizer } from './dependency-optimizer'
 * import { loadCompatibilityTree } from '../compatibility-tree'
 * 
 * async function optimizeDependencies() {
 *   const tree = await loadCompatibilityTree()
 *   const optimizer = createDependencyOptimizer(tree)
 *   
 *   const report = await optimizer.analyzeAndOptimize()
 *   console.log('优化报告:', report)
 * }
 * ```
 */